{extend name="layout:base" /}
{block name="style"}
<link rel="stylesheet" href="__STATIC__/kindeditor/themes/default/default.css"/>
<script charset="utf-8" src="__STATIC__/kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="__STATIC__/kindeditor/lang/zh-CN.js"></script>
{/block}
{block name="content"}
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header">{$company.title}</div>
        <div class="layui-card-body">
            <form class="layui-form">
                <input type="hidden" name="id" value="{$company.id}">
                <div class="layui-row layui-form-item">
                    <div class="layui-col-sm12 layui-col-md3">
                        <label class="layui-form-label">坐席：</label>
                        <div class="layui-form-mid layui-word-aux">{$company.seat_number}</div>
                    </div>
                    <div class="layui-col-sm12 layui-col-md3">
                        <label class="layui-form-label">归属地：</label>
                        <div class="layui-form-mid layui-word-aux">{$company.city}</div>
                    </div>
                    <div class="layui-col-sm12 layui-col-md3">
                        <label class="layui-form-label">话费首冲：</label>
                        <div class="layui-form-mid layui-word-aux">{$company.money_sc}</div>
                    </div>
                    <div class="layui-col-sm12 layui-col-md3">
                        <label class="layui-form-label">单价/分钟：</label>
                        <div class="layui-form-mid layui-word-aux">{$company.price}</div>
                    </div>
                </div>
                <div class="layui-row layui-form-item">
                    <div class="layui-col-sm12 layui-col-md3">
                        <label class="layui-form-label">开户时间：</label>
                        <div class="layui-form-mid layui-word-aux">{$company.created_time}</div>
                    </div>
                    <div class="layui-col-sm12 layui-col-md3">
                        <label class="layui-form-label">服务到期：</label>
                        <div class="layui-form-mid layui-word-aux">{$company.server_endtime}</div>
                    </div>
                    <div class="layui-col-sm12 layui-col-md3">
                        <label class="layui-form-label">所属客服：</label>
                        <div class="layui-form-mid layui-word-aux">{$company.kfname}</div>
                    </div>
                </div>
                <div class="layui-row layui-form-item">
                    <div class="layui-col-sm12 layui-col-md3">
                        <label class="layui-form-label">身份证：</label>
                        <a target="_blank" href="{$company.card_id}"><img src="{$company.card_id}" height="50"/></a>
                    </div>
                    <div class="layui-col-sm12 layui-col-md3">
                        <label class="layui-form-label">营业执照：</label>
                        <div class="layui-input-inline">
                            <a target="_blank" href="{$company.business_lic}"><img src="{$company.business_lic}" height="50"/></a>
                        </div>
                    </div>
                </div>
                <div class="layui-row layui-form-item">
                    <label class="layui-form-label">备注：</label>
                    <div class="layui-form-mid layui-word-aux">{$company.remarks}</div>
                </div>
                <div class="layui-row layui-form-item">
                    <label class="layui-form-label">坐席后台：</label>
                    <div class="layui-form-mid layui-word-aux">{$company.backurl}</div>
                </div>
                <div class="layui-row layui-form-item">
                    <label class="layui-form-label">坐席帐号：</label>
                    <div class="layui-form-mid layui-word-aux">{$company.backname}</div>
                </div>
                <div class="layui-row layui-form-item">
                    <label class="layui-form-label">坐席密码：</label>
                    <div class="layui-form-mid layui-word-aux">{$company.backpwd}</div>
                </div>
                <div class="layui-row layui-form-item">
                    <label class="layui-form-label">坐席号码：</label>
                    <div class="layui-form-mid layui-word-aux">{$company.back_remark}</div>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}

{block name="script"}
<script>
    layui.config({
        base: '__STATIC__/layuiadmin/' //静态资源所在路径
    }).extend({
        index: '/lib/index' //主入口模块
    }).use(['index', 'table', 'jquery', 'layer', 'form', 'element', 'upload','laydate'], function () {
        var $ = layui.$,
            layer=layui.layer,
            form = layui.form,laydate = layui.laydate;

        laydate.render({
            elem: '#created_time' //指定元素
        });
        laydate.render({
            elem: '#server_endtime' //指定元素
        });
        form.on('submit(btnSave)', function (data) {
            // console.log(data.field);
            $.post("{:url('edit')}", data.field, function (result) {
                if (result['code'] == 0) {
                    layer.msg(result['msg'], {icon: 1, time: 1000}, function () {
                        parent.location.reload();
                    });
                } else {
                    layer.msg(result['msg'], {icon: 3, time: 3000});
                }
            });
            return false;
        });
    });

    var editor;
    KindEditor.ready(function (K) {
        editor = K.create('textarea[name="content"]', {
            allowFileManager: true
        });
        K('#btnImgUpload').click(function () {
            editor.loadPlugin('image', function () {
                editor.plugin.imageDialog({
                    imageUrl: K('#imageurl').val(),
                    clickFn: function (url, title, width, height, border, align) {
                        K('#imageurl').val(url);
                        editor.hideDialog();
                        K('#imageView').html('');
                        K('#imageView').append('<img src="' + url + '" height="50">');
                    }
                });
            });
        });
        K('#btnImgUpload2').click(function () {
            editor.loadPlugin('image', function () {
                editor.plugin.imageDialog({
                    imageUrl: K('#imageurl2').val(),
                    clickFn: function (url, title, width, height, border, align) {
                        K('#imageurl2').val(url);
                        editor.hideDialog();
                        K('#imageView2').html('');
                        K('#imageView2').append('<img src="' + url + '" height="50">');
                    }
                });
            });
        });
    });
</script>
{/block}


